package com.augmentum.oes.model;

import java.text.SimpleDateFormat;
import java.util.Date;
import com.augmentum.oes.annotation.Orm.Column;
import com.augmentum.oes.annotation.Orm.Table;

@Table("exam")
public class Exam {
    @Column("id")
    private int id;
    @Column("exam_name")
    private String examName;
    @Column("single_score")
    private int singleScore;
    @Column("total_score")
    private int totalScore;
    @Column("question_quantity")
    private int questionQuantity;
    @Column("exam_duration")
    private int duration;
    @Column("pass_criteria")
    private int passCriteria;
    @Column("create_time")
    private Date createTime;
    @Column("update_time")
    private Date updateTime;
    @Column("exam_description")
    private String examDescription;
    @Column
    private int creatorId;
    @Column("effective_time")
    private Date effectiveTime;
    private String creator;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getExamName() {
        return examName;
    }

    public void setExamName(String examName) {
        this.examName = examName;
    }

    public int getSingleScore() {
        return singleScore;
    }

    public void setSingleScore(int singleScore) {
        this.singleScore = singleScore;
    }

    public int getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(int totalScore) {
        this.totalScore = totalScore;
    }

    public int getQuestionQuantity() {
        return questionQuantity;
    }

    public void setQuestionQuantity(int questionQuantity) {
        this.questionQuantity = questionQuantity;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public int getPassCriteria() {
        return passCriteria;
    }

    public void setPassCriteria(int passCriteria) {
        this.passCriteria = passCriteria;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getExamDescription() {
        return examDescription;
    }

    public void setExamDescription(String examDescription) {
        this.examDescription = examDescription;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public int getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(int creator) {
        this.creatorId = creator;
    }

    public String getEffectiveTime() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        return sdf.format(effectiveTime);
    }

    public void setEffectiveTime(Date effectiveTime) {
        this.effectiveTime = effectiveTime;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    @Override
    public String toString() {
        return "Exam [id=" + id + ", examName=" + examName + ", singleScore=" + singleScore + ", totalScore="
                + totalScore + ", questionQuantity=" + questionQuantity + ", duration=" + duration + ", passCriteria="
                + passCriteria + ", createTime=" + createTime + ", updateTime=" + updateTime + ", examDescription="
                + examDescription + ", creatorId=" + creatorId + ", effectiveTime=" + effectiveTime + ", creator="
                + creator + "]";
    }

}
